import { createRouter, createWebHistory } from "vue-router";
import index from "@/views/index/index.vue"
import particle1 from "@/views/particle/components/Particle.vue"
import helloWorld from "@/views/helloworld/components/hello-world.vue";
const routes = [
  {
    path: "/", // 首页页面
    component: index,
    redirect: { path: "/hello-world" },
    children: [
      {
        path: "/hello-world",
        name: "hello-world",
        component: () => import("@/views/helloworld/useHelloWorld.vue")
      },
      {
        path: "/resource-tree",
        name: "resource-tree",
        component: () => import("@/views/resource-tree/useResourceTree.vue")
      },
      {
        path: "/project",
        name: "project",
        component: () => import("@/views/project/useProject.vue")
      },
      {
        path: "/particle",
        name: "particle",
        component: () => import("@/views/particle/useParticle.vue")
      },
    ]
  },
  {
    path: "/particle/particle1", // 首页页面
    component: particle1,
  },
  {
    path: "/hello-world/helloworld", // 首页页面
    component: helloWorld,
  },
];
// console.log(import.meta.env.BASE_URL);
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
});

export default router;
